package com.bs.dao.impl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import com.bs.bean.Manager;
import com.bs.dao.ManagerDAO;

public class ManagerDAOImpl extends SqlMapClientDaoSupport implements ManagerDAO {

	@Override
	public int delete(Manager manager) {
		return this.getSqlMapClientTemplate().delete("manager.delete",manager);
	}
	
	@Override
	public int batchDelete(String ids) {
		return this.getSqlMapClientTemplate().delete("manager.batchDelete",ids);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Manager> findAll() {
		return this.getSqlMapClientTemplate().queryForList("manager.findAll");
	}

	@Override
	public void save(Manager manager){
		this.getSqlMapClientTemplate().insert("manager.save", manager);
	}

	@Override
	public Manager getManager(Manager manager) {
		return (Manager) this.getSqlMapClientTemplate().queryForObject("manager.getManager",manager);
	}

	@Override
	public int update(Manager manager) {
		return this.getSqlMapClientTemplate().update("manager.update",manager);
	}
	
	
}
